﻿
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;

namespace EHU_InterfaceProgramming
{
    
    public class InputCodeDisplay
    {
        public outputCodeDisplay output;
        protected TextBlock[] InputOptions = new TextBlock[5];
      
        /// <summary>
        /// Initialises the 5 Options on the GUI to ensure that they are blank, 
        /// also registers the textbox objects from the GUI to ensure that they can be tracked from here. 
        /// </summary>
        /// <param name="txtA">TextBlock Object A </param>
        /// <param name="txtB">TextBlock Object B </param>
        /// <param name="txtC">TextBlock Object C </param>
        /// <param name="txtD">TextBlock Object D </param>
        /// <param name="txtE">TextBlock Object E </param>
        public InputCodeDisplay(TextBlock txtA, TextBlock txtB, TextBlock txtC,TextBlock txtD,TextBlock txtE)
        {
            InputOptions[0] = txtA;
            InputOptions[1] = txtB;
            InputOptions[2] = txtC;
            InputOptions[3] = txtD;
            InputOptions[4] = txtE;

            for (int i = 0; i <= 4; i++)
            {
                InputOptions[i].Text = "";
            }
            
        }

       
        /// <summary>
        /// Set the 5 options on the GUI. 
        /// If an option is left blank, its corrisponding control will be disabled on the GUI
        /// </summary>
        /// <param name="Options"> A five element string array containing the options to be set.
        /// Option A is set from element 0 through to E in element 4.</param>
        public void setOptions(string[] Options)
        {
            for (int i = 0; i <= 4; i++)
            {
                InputOptions[i].Text = Options[i];
                if (Options[i] == "")
                {
                    InputOptions[i].Visibility = System.Windows.Visibility.Hidden;
                }
                else if (Options[i] != "" && InputOptions[i].Visibility == System.Windows.Visibility.Hidden)
                {
                    InputOptions[i].Visibility = System.Windows.Visibility.Visible;
                }

            }
        }
        /// <summary>
        /// Takes the option selected by the user from the suggested code options, and calles the 
        /// relevant outputCodeDisplayMethods to add the code to the output window.
        /// </summary>
        /// <param name="selected">The option selected by the user.</param>
        public void optionSelected(int selected)
        {
            string optionChosen = InputOptions[selected].Text;
            switch (optionChosen)
            { 
                   
                case "Class":
                    
                    return;

                case "Method":
                    return;

                case "If":
                    return;

                case "For":
                    return;
            }

        }

    }
}
